<?php

/**
 * description
 **/
class BackendCommentFormFilter extends CommentFormFilter
{
  /**
   * 
   */
  public function configure()
  {
    $this->widgetSchema['article']    = new sfWidgetFormInputText();
    $this->validatorSchema['article'] = new sfValidatorPass();

    $this->widgetSchema['author']    = new sfWidgetFormInputText();
    $this->validatorSchema['author'] = new sfValidatorPass();
  }

  public function addArticleColumnQuery($query, $field, $values)
  {
    $query->addWhere("a.title like ?", "%{$values}%");
  }

  public function addAuthorColumnQuery($query, $field, $values)
  {
    $query->addWhere("u.account like ?", "%{$values}%");
  }
}
